package com.novoda.runbuddy.view;

import android.view.View;
import android.widget.Button;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.novoda.runbuddy.controller.MapOfJogsControllerImpl;

public class MapOfJogsView {

	@SuppressWarnings("unused")
	private MapActivity				mapActivity;
	private MapOfJogsControllerImpl	mapOfJogController;
	public MapView					mapView;

	public MapOfJogsView(MapActivity mapActivity, MapOfJogsControllerImpl mapOfJogControllerImpl, Button goButton, MapView mapView) {
		this.mapActivity = mapActivity;
		this.mapView = mapView;
		this.mapOfJogController = mapOfJogControllerImpl;

		goButton.setOnClickListener(GoClickListener);
	}

	public void invalidateMapView() {
		this.mapView.invalidate();
	}

	public void toggleSatellite() {
		
		if(mapView.isSatellite()){
			mapView.setSatellite(false);
		}else{
			mapView.setSatellite(true);			
		}
	}

	public boolean isSatellite() {
		return this.mapView.isSatellite();
	}

	public int getZoomLevel() {
		return this.mapView.getZoomLevel();
	}

	View.OnClickListener	GoClickListener	= new View.OnClickListener()
											{
												public void onClick(View arg0) {
													mapOfJogController.plotChosenJog();
													MapOfJogsView.this.mapOfJogController.mapOfJogView.mapView.invalidate();
												}
											};
}
